package com.cloudwise.isop.kg.utils;

import lombok.extern.slf4j.Slf4j;
import org.activiti.engine.RepositoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * @author JefferyChang
 * @date 2020/7/11
 */
@Component
@Slf4j
public class InitLoad implements CommandLineRunner {
    @Autowired
    private RepositoryService repositoryService;

    @Override
    public void run(String... args) {
        log.info("<=========================== 初始化 项目执行  =====================>");
        deployBPMN();
    }

    // 暂时屏蔽，使用接口主动初始化
    private void deployBPMN(){
//         repositoryService.createDeployment().addClasspathResource("processes/UploadCase.bpmn").addClasspathResource("processes/UploadCase.png").deploy();
//         repositoryService.createDeployment().addClasspathResource("processes/MyProcess.bpmn").addClasspathResource("processes/MyProcess.png").deploy();
    }

}